<template>
  <div>
    <div v-for="(item, i) in obj.arr" :key="i">{{item}}</div>
    <div @click="puls">+</div>
    <div @click="minus">-</div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      obj: {}
    }
  },
  props: {
    test: {
      type: Object,
    },
  },
  watch: {
    test(n, o) {
      console.log(n, o)
      this.obj = n;
    },
    obj(n){
      console.log(n)
    }
  },
  created() {
    // console.log(this.test)
    // this.obj = {
    //   arr: [1, 2]
    // }
  },
  methods: {
    minus() {
      this.obj.arr.push(1);
    },
    puls() {
      this.obj.arr.splice(1, 1);
    },
  }
}
</script>
